GXHandleAlertEvent
You need to override theGXHandleAlertEvent
message if you are providing custom handling of printing alerts. Your override code of theGXHandleAlertEvent
message must match the following formal declaration:
OSErr MyHandleAlertEvent (gxStatusRecord *aStatusRecord, DialogPtr *aDialogPtr, EventRecord *theEvent, short *itemHit);
aStatusRecord
- A pointer to the status structure.
aDialogPtr
- The handle to the printing alert box.
theEvent
- A pointer to the event structure containing the alert event.
itemHit
- The ID of the dialog item that was selected by the user.
- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
QuickDraw GX sends theGXHandleAlertEvent
message when a printer driver calls theGXAlertTheUser
function with a status structure containing a status type ofgxUserAlert
.The default implementation of this message handles the standard set of status alerts. If this message is forwarded to the universal driver and if it is not a message for the universal driver, the default implementation assumes that the caller has set up a printing alert box and handles the event accordingly.
You do not need to override this message if your alert is one of the standard alerts for which QuickDraw GX provides automatic handling, as described in the chapter "Printer Drivers" in this book. If you want to provide custom alerts, first check the
statusOwner
field of the status structure to make sure that this message is intended for you. If so, perform a total override of this message.In your override, you need to check the event. If the status event dismisses the printing alert box, fill in the
dialogResult
field of the status structure with a nonzero value to inform the Finder that the dialog box can be removed.SPECIAL CONSIDERATIONS
You never send theGXHandleAlertEvent
message yourself.If you handle the event, you must totally override the
GXHandleAlertEvent
message. Otherwise, forward the message so that another message handler can process the event.RESULT CODES
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. SEE ALSO
You can find an example of an override of theGXHandleAlertEvent
message in Listing 3-18 on page 3-48 in the chapter "Printer Drivers."The
GXAlertTheUser
function is described on page 5-18 in the chapter "Printing Functions for Message Overrides."The status structure is described on page 4-39.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help